<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <style>
        [v-cloak] {
            display: none;
        }

        html,
        body {
            background-color: rgba(255,255,255,0.00001);
            padding: 0;
            margin: 0;
        }

        #app{
            padding: 0;
        }

        .header{
            height: 40px;
            width: 100%;
            padding: 5px 0;
            background-color: #21243A;
            opacity: 0.7;
            /*border-top-left-radius: 20px;
            border-top-right-radius: 20px;*/
            display: block;
            position: relative;
        }

        .header .close{
            height: 22px;
            width: 22px;
            padding: 10px;
            float: left;
        }

        .header p{
            right: 56px;
            left: 56px;
            display: inline-block;
            overflow: hidden;
            width: auto;
            margin: 0;
            padding: 0;
            text-overflow: ellipsis;
            line-height: 44px;
            position: absolute;
            text-align: center;
            white-space: nowrap;
            color: #FEFEFE;
            font-size: 20px;
        }

        .content-container{
            background-color: #FEFEFE;
            height: auto;
            overflow: scroll;
        }

        .content{
            padding: 10px 20px;
        }

        .comment-item{
            padding: 10px 20px;
            position: relative;
            background-color: #FEFEFE;
            border-bottom: 1px solid #f1f1f1;
            text-align: left;
        }
        .avatar{
            height: 44px;
            width: 44px;
            border-radius: 50%;
            float: left;
            background-image: url('../../image/avatar.png');
            background-position: center;
            background-size: contain;
            border: 5px solid #ddd;
        }
        .comment-detail{
            margin-left: 64px;
        }
        .comment-name{
            font-size: 16px;
            color: #515151;
            padding: 0;
            margin: 0;
            font-weight: bold;
        }
        .comment-time{
            font-size: 14px;
            color: #515151;
            padding: 5px 0;
        }
        .comment-content{
            font-size: 16px;
            color: #515151;
            width: auto;
            word-wrap: break-word;
            word-break: break-all;
        }

        /*没有数据，正在加载*/
        .loading{
            text-align: center;
            padding-top: 10px;
            padding-bottom: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .loading img{
            height: 40px;
            width: 40px;
            animation: que 1.6s linear infinite;
        }
        @keyframes que{
            0%{
                transform: rotate(0deg);
            }
            100%{
                transform: rotate(360deg);
            }
        }

    </style>
</head>

<body>

    <div id="app" v-cloak>

        <div class="header">
            <img src="../../image/close.png" alt="" class="close" @click="close">
            <p>番剧评论</p>
        </div>

        <div class="content-container" ref="container">

            <div class="comment-item" v-for="(item, index) in commentsList" :key="index">
                <img class="avatar" :src="getAvatar(item.uqq)" alt="">
                <div class="comment-detail">
                    <p class="comment-name">{{item.uname}}</p>
                    <p class="comment-time">{{item.ctime}}</p>
                    <p class="comment-content">{{item.content}}</p>
                </div>
            </div>

            <!-- 提示数据为空图片 -->
            <div class="tips" style="text-align:center;">
                <img src="../../image/empty.png" style="width:200px;height:160px;margin-top:20px;" alt="" v-if="commentsList === null">
                <p style="font-size:14px;color:#999;" v-if="commentsList === null">空空如也</p>
            </div>
            <!-- 提示网络错误图片 -->
            <div class="tips" style="text-align:center;margin-bottom:20px;" v-show="isError" @click="reload">
                <img src="../../image/error.png" style="width:200px;height:160px;margin-top:20px;" alt="">
                <p style="font-size:14px;color:#999;">喔！出错啦，点我重试</p>
            </div>
            <!-- 加载图标 -->
            <div class='loading' v-show="loading">
                <img src='../../image/loading.png'>
            </div>

        </div>

    </div>

    <script src="../../script/vendors/api.js"></script>
    <script src="../../script/vendors/vue.min.js"></script>
    <script src="../../script/vendors/axios.min.js"></script>
    <script src="../../script/vendors/md5.min.js"></script>
    <script src="../../script/dist/avComments.js"></script>
</body>

</html>
